import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DeliveryFnskuBaseInfoVO, DeliveryFnskuBaseInfoForm, DeliveryFnskuBaseInfoQuery } from '@/api/delivery/deliveryFnskuBaseInfo/types';

/**
 * 查询发货计划FNSKU基础信息列表
 * @param query
 * @returns {*}
 */

export const listDeliveryFnskuBaseInfo = (query?: DeliveryFnskuBaseInfoQuery): AxiosPromise<DeliveryFnskuBaseInfoVO[]> => {
  return request({
    url: '/delivery/deliveryFnskuBaseInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询发货计划FNSKU基础信息详细
 * @param id
 */
export const getDeliveryFnskuBaseInfo = (id: string | number): AxiosPromise<DeliveryFnskuBaseInfoVO> => {
  return request({
    url: '/delivery/deliveryFnskuBaseInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增发货计划FNSKU基础信息
 * @param data
 */
export const addDeliveryFnskuBaseInfo = (data: DeliveryFnskuBaseInfoForm) => {
  return request({
    url: '/delivery/deliveryFnskuBaseInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改发货计划FNSKU基础信息
 * @param data
 */
export const updateDeliveryFnskuBaseInfo = (data: DeliveryFnskuBaseInfoForm) => {
  return request({
    url: '/delivery/deliveryFnskuBaseInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除发货计划FNSKU基础信息
 * @param id
 */
export const delDeliveryFnskuBaseInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/delivery/deliveryFnskuBaseInfo/' + id,
    method: 'delete'
  });
};
